<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@page import="com.yaodian100.ec.product.service.Product2Service"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<c-rt:set var="imgDomain"><%=ServerValue.getImgDomain()%></c-rt:set>
<%
Product2Service product2Service = (Product2Service)WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()).getBean(Product2Service.class);
String addOnProductId = request.getParameter("addOnProductId");
%>
 <script language="javascript">
$().ready(function(){
	$("#dialog").dialog({
		bgiframe: true,
		height: 590,
		width:337,
		modal: true
	});
	$("#presentCloseBtn").click(function(){	
		closeDialog();
		return false;
	});
});
</script>
<div id="dialog">
<c-rt:if test="${!empty param.productId}">
	${pu:reqSet('product', pu:get('com.yaodian100.ec.product.entity.Product', param.addOnProductId))}
	${pu:listAdd('parasShelf', param.addOnProductId)}
    ${pu:reqSet('shelfs', pu:queryByHql('from Shelf where productId=?', pu:arrayGet('parasShelf'), null))}
    ${pu:reqSet('addOnHql', 'from AddOnProduct where mainProductId=? and addOnProductId=?')}
    ${pu:listAdd('paras', pu:toString(param.productId))}
    ${pu:listAdd('paras', param.addOnProductId)}
    ${pu:reqSet('addOnProducts', pu:queryByHql(addOnHql, pu:arrayGet('paras'), null))}
</c-rt:if>
<c-rt:if test="${param.capture=='true'}">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="description" content="" />
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
</head>
<body></c-rt:if>
  <div class="presentp"> <a href="javascript:;"><img src="${imgDomain}/PImg/${pu:substring(product.productId, 0, 4)}/${product.productId }/${product.productId }_m250.jpg" onError="this.src='/PImg/blank_250.gif'" alt="" width="250" height="250" /></a> 
    <p class="pprice">市场价￥<span><fmt-rt:formatNumber value="${product.listPrice }"  pattern="####0.0"/></span> <b>加购价￥ <em><fmt-rt:formatNumber value="${addOnProducts[0].addOnPrice}"  pattern="####0.0"/></em></b> </p> 
  </div> 
  <div class="detail-text"> <em>${shelfs[0].promoteName}</em> 
    <h5>${product.productName }</h5> 
    <p>${product.productBrief }</p> 
		<%if ( product2Service.chkVolumeOfProduct(addOnProductId)){%>
			<p class="txt-bk"><br />运送限定：<span class="txt-rd">大材积</span><a href="/help/1_bigsize.html" target="_blank">(详情)</a></p>
		<%} %>    
		<p class="txt-bk"><br />商品重量：
			<c-rt:if test="${product.productWeight>0}">
		     <fmt-rt:formatNumber value="${(product.productWeight+0.001)/1000 }"  pattern="#,#0.00#"/>
		  </c-rt:if>
		  <c-rt:if test="${product.productWeight<=0}">0</c-rt:if>
		  kg (<a href="/help/6_deliveryfee.html" target="_blank">重量与运费说明</a>)
		</p>  
	</div>
<c-rt:if test="${param.capture=='true'}">
</body></html>body</c-rt:if>
<p align="center"><a id="presentCloseBtn" href="javascript:;" class="btn-mid">关闭</a></p> 
</div>
